package com.midele.goodstuff.ui.search

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.midele.goodstuff.ui.search.screen.SearchScreen
import com.midele.goodstuff.ui.theme.MidGoodStuffTheme

class SearchActivity : ComponentActivity() {
    @OptIn(ExperimentalMaterial3Api::class)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContent {
            val systemUiController = rememberSystemUiController()
            val isDarkFont = false // 根据主题动态判断
            SideEffect {
                systemUiController.setStatusBarColor(
                    color = Color.Companion.Transparent, // 状态栏背景色
                    darkIcons = isDarkFont     // 字体颜色（true: 白色，false: 黑色）
                )
            }

            MidGoodStuffTheme {
                //SearchScreen()
            }
        }
    }
}

@Composable
fun Greeting(name: String, modifier: Modifier = Modifier.Companion) {
    Text(
        text = "Hello $name!",
        modifier = modifier
    )
}